import request from '@/router/axios'
import store from '@/store'
export function exportExcel(query) {
  return request({
    url: '/stm/swsttvmsupplementcurrency/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

export function fetchList(query) {
  return request({
    url: '/stm/swsttvmsupplementcurrency/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/stm/swsttvmsupplementcurrency',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/stm/swsttvmsupplementcurrency/details/' + id,
    method: 'get'
  })
}

export function getSupplementCoinDetails(id) {
  return request({
    url: '/stm/swsttvmsupplementcurrency/coindetails/' + id,
    method: 'get'
  })
}

export function getSupplementPaperDetails(id) {
  return request({
    url: '/stm/swsttvmsupplementcurrency/paperdetails/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/stm/swsttvmsupplementcurrency/' + id,
    method: 'delete'
  })
}

export function delBatch(id) {
  return request({
    url: '/stm/swsttvmsupplementcurrency/batchCascadeDel',
    method: 'delete',
    data:id
  })
}

export function putObj(obj,cashBoxType) {
  return request({
    url: '/stm/swsttvmsupplementcurrency?cashBoxType='+cashBoxType,
    method: 'put',
    data: obj
  })
}
export function coinPutObj(obj,cashBoxType) {
  return request({
    url: '/stm/swsttvmsupplementcurrency?cashBoxType='+cashBoxType,
    method: 'put',
    data: obj
  })
}
export function paperPutObj(obj,cashBoxType) {
  return request({
    url: '/stm/swsttvmsupplementcurrency?cashBoxType='+cashBoxType,
    method: 'put',
    data: obj
  })
}
export function getTvmCode(){
  return request({
    url: "/support/swpmtvmcode/page?size=-1&status=1&stationCode=" + store.getters.userInfo.stationCode,
    method:"get"
  })
}
export function getTvmSupplementCurrency(param) {
  return request({
    url: "/stm/swsttvmsupplementcurrency/getTvmSupplementCurrency",
    method: "post",
    params: param
  });
}


//查看补币历史记录
export function queryPastRecords(param){
  return request({
    url: '/stm/swsttvmsupplementcurrency/getLogById/'+param.id,
    method: 'get'
  })
}

//查看补币历史记录明细
export function queryPastRecordsDetail(param){
  return request({
    url: '/stm/swsttvmsupplementcurrency/getLogChildById/'+param.id,
    method: 'get'
  })
}

export function getTvmCashBoxNum(query) {
  return request({
    url: '/support/swpmtvmcashboxcode/page',
    method: 'get',
    params: query
  })
}

export function getPeriods(query) {
  return request({
    url: '/check/xw_js_tvm/getPeriods',
    method: 'post',
    params: query
  })
}

